Skip to content

feat(connections): Support mssql-python driver.#5647

Open
walanguzzi wants to merge 9 commits into
SQLMesh:mainfrom
walanguzzi:feature/support-mssql-python-driver
Open

feat(connections): Support mssql-python driver.#5647
walanguzzi wants to merge 9 commits into
SQLMesh:mainfrom
walanguzzi:feature/support-mssql-python-driver

Conversation

@walanguzzi

@walanguzzi walanguzzi commented Jan 8, 2026

Copy link
Copy Markdown

Background

Issue #5645 - support the official mssql-python driver from Microsoft.

The new driver implements PEP 249 interfaces and should work as a pluggable drop-in: https://pypi.org/project/mssql-python/

Motivation

The driver bundles a lightweight and high-performance binary layer replacing the platform's Driver Manager hence eliminating the need for system-level ODBC installations.

As per the mssql-python overview, additional benefits include:

  • Consistency across platforms
  • Lower function call overhead
  • Zero external dependencies on Windows (the mssql-python is all that's needed)
  • Full control over connections, memory, and statement handling

Code Changes

  • Implemented connect_mssql_python and moved the prior pyodbc logic to connect_pyodbc.
  • Added driver configuration support for "mssql-python" to relevant *ConnectionConfig classes:
    • MSSQLConnectionConfig
    • AzureSQLConnectionConfig
    • FabricConnectionConfig
  • Updated documentation.
  • Automated refactors around import order (done by ruff and pylance).

Test Plan

All CI runs are successful.

The fast-test, slow-test and doc-test targets are also passing (locally).

However, there is one issue with the test_state_sync:test_version_schema test case being "out of sync" and prompting for a migration when run locally - I have yet to resolve this.

@CLAassistant

CLAassistant commented Jan 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@walanguzzi walanguzzi marked this pull request as ready for review January 8, 2026 03:54
douglaso-profusion and others added 5 commits January 8, 2026 04:01
DATETIMEOFFSET is natively supported by `mssql-python`.

See "microsoft/mssql-python#213"
- Added a TODO re its removal as it should already
  be supported natively by `mssql-python`.
chore: Sync upstream `main`.
@codykonior-hsi

codykonior-hsi commented Mar 11, 2026

Copy link
Copy Markdown

I'm interested in having this driver in the product because the existing driver does not work well with my VPN. I have a set of patches I use to do it, but, didn't submit them because I couldn't do it very cleanly.

I can't comment on the PR itself.

@RG-sw

RG-sw commented May 22, 2026

Copy link
Copy Markdown

@walanguzzi thanks for the contribution! Are there any updates on this pending PR? Is there someone we can ping?

@walanguzzi

Copy link
Copy Markdown
Author

Thanks @RG-sw and @codykonior-hsi. We've been waiting for a review from one of the maintainers, however, it seems this branch is now out-of-date and needs rebasing against main (CC-GHA migration etc.).

I will do this within the next few days and then try to @ someone from the team so hopefully it gains some traction🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants